import { RouteRecordRaw } from 'vue-router'
import BasicLayout from "@/components/layout"
import { default as Components } from '@/views'
import { default as errorPages } from '@/errorPages'
export const constantRouterMap: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: (to => { return { path: '/home/list' } })
  },
  {
    path: '/home',
    name: 'home',
    component: BasicLayout,
    children: [{
      path: 'list',
      meta: {
        title: '首页列表',
        auth: true,
        page_type: 1,
      },
      component: Components.Home
    }]
  },
  {
    path: '/login',
    name: 'login',
    component: Components.Login
  },
  {
    path: '/403',
    name: '403',
    component: errorPages[403]
  },
  {
    path: '/404',
    name: '404',
    component: errorPages[404]
  },
  {
    path: '/500',
    name: '500',
    component: errorPages[500]
  },
  {
    path: '/vue2App',
    name: 'vue2App',
    children: [{
      path: 'list',
      meta: {
        auth: true, title: 'vue2-app',
        page_type: 1,
      },
      component: BasicLayout,
    }],
  },
  {
    path: '/vue3App',
    name: 'vue3App',
    children: [{
      path: 'list',
      meta: {
        auth: true, title: 'vue3-app',
        page_type: 1,
      },
      component: BasicLayout,
    }],
  },
  {
    path: '/react',
    name: 'react',
    children: [{
      path: 'list',
      meta: {
        auth: true, title: 'react-app',
        page_type: 1,
      },
      component: BasicLayout,
    }],
  }
]
// 白名单(路径)
export const whiteList = ['/login', '/403', '/404', '/500']